package com.chhuang;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.core.env.Environment;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @ClassName ChhuangbootWebApplication
 * @Description springboot启动类
 * @Author Darren Huang
 * @Date 2022/11/18 13:44
 * @Version 1.0
 */
@Slf4j
@SpringBootApplication
//@EnableOpenApi//swagger3
@EnableSwagger2//swagger2
//@MapperScan(basePackages = {"com.chhaung.mapper"})
@EnableCaching
public class ChhuangbootWebApplication {

    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(ChhuangbootWebApplication.class);
        Environment env = application.run(args).getEnvironment();
        try {
            String port = env.getProperty("server.port");
            log.info("\n----------------------------------------------------------\n\t" +
                            "SwaggerUI: \thttp://localhost:{}/doc.html\n" +
                            "----------------------------------------------------------",
                    port);
        } catch (Exception e) {
            log.error(e.getMessage());
        }
    }

}
